<?php

namespace  Application\Model;

use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;

class Order implements InputFilterAwareInterface {

    public $id;
    public $coupon_code;
    public $first_name;
    public $last_name;
    public $email_address;
    public $address;
    public $city;
    public $zip_code;
    public $country;
    public $phone;
    public $paypal_code;
    public $date_created;
    public $date_updated;
    public $total_price;
    public $token;
    public $payer;
    public $payerid;
    public $payerstatus;
    public $payercountry;
    public $ack;
    public $security_code;
    public $status;

    protected $inputFilter;

    public function exchangeArray($data) {
        $this->id = (isset($data['id'])) ? $data['id'] : null;
        $this->coupon_code = (isset($data['coupon_code'])) ? $data['coupon_code'] : null;
        $this->first_name = (isset($data['first_name'])) ? $data['first_name'] : null;
        $this->last_name = (isset($data['last_name'])) ? $data['last_name'] : null;
        $this->email_address = (isset($data['email_address'])) ? $data['email_address'] : null;
        $this->address = (isset($data['address'])) ? $data['address'] : null;
        $this->city = (isset($data['city'])) ? $data['city'] : null;
        $this->zip_code = (isset($data['zip_code'])) ? $data['zip_code'] : null;
        $this->country = (isset($data['country'])) ? $data['country'] : null;
        $this->phone = (isset($data['phone'])) ? $data['phone'] : null;
        $this->paypal_code = (isset($data['paypal_code'])) ? $data['paypal_code'] : null;
        $this->date_created = (isset($data['date_created'])) ? $data['date_created'] : null;
        $this->date_updated = (isset($data['date_updated'])) ? $data['date_updated'] : null;
        $this->total_price = (isset($data['total_price'])) ? $data['total_price'] : null;
        $this->token = (isset($data['token'])) ? $data['token'] : null;
        $this->payer = (isset($data['payer'])) ? $data['payer'] : null;
        $this->payerid = (isset($data['payerid'])) ? $data['payerid'] : null;
        $this->payerstatus = (isset($data['payerstatus'])) ? $data['payerstatus'] : null;
        $this->payercountry = (isset($data['payercountry'])) ? $data['payercountry'] : null;
        $this->ack = (isset($data['ack'])) ? $data['ack'] : null;
        $this->security_code = (isset($data['security_code'])) ? $data['security_code'] : null;
        $this->status = (isset($data['status'])) ? $data['status'] : null;



    }

    public function getArrayCopy() {
        return get_object_vars($this);
    }

    public function setInputFilter(InputFilterInterface $inputFilter) {
        $this->inputFilter = $inputFilter;
//            throw new \Exception("Not used");
    }

    public function getInputFilter() {
        if (!$this->inputFilter) {
			$inputFilter = new InputFilter();
			$factory     = new InputFactory();


			$inputFilter->add($factory->createInput(array(
					'first_name'     => 'content',
					'required' => true,
			)));
			$this->inputFilter = $inputFilter;
		}

		return $this->inputFilter;
    }

}